<?php
/**
 * Crontab 
 * Add php path infomation in 'PATH' Env Variable
 * @author	zhangjian<smile_for_life@sina.cn>
 * @date	2014-01-14
 */
 class Crontab
 {
	public $_interval = 1;// second
	protected $_script_path = '';
	
	public function __construct()
	{
		$this->_script_path = realpath(dirname(__FILE__));
		
		$this->_init();
	}
	
	public function _init()
	{
		error_reporting(0);// error_reporting(E_ALL ^ E_NOTICE);
		ignore_user_abort(true);
		date_default_timezone_set('Asia/Shanghai');
		set_time_limit(0);
		@ini_set('memory_limit', '120M');
	}
	
	public function handle()
	{
		while(1){
			$this->do_task();
			sleep($this->_interval);
		}
	}
	
	/**
	 * run task
	 */
	public function do_task()
	{
		
	}
	
 }